package com.szwistar.common.comm.jsonrpc;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/**
 * JSON-RPC 通知消息
 * 接收端接收到通知消息后，不需作出回应
 */
@JsonInclude(value=Include.NON_NULL)
public class JsonRpcMessageNotify extends JsonRpcMessageAuthorizedRequest {
	public JsonRpcMessageNotify() {
		super();
		this.msgType = MSG_NOTIFY;
	}

    public JsonRpcMessageNotify(String from, String token, String method, String params) {
		super(MSG_NOTIFY, from, token, method, params);
	}

	@Override
	public String toString() {
		String msg = "";
		if(params != null) { msg = (params.length() < 96) ? params : params.substring(0, 96) + " ..."; }
		return String.format("JsonRpcMessageNotify [%s:'%s', token=%s, from=%s]", method, msg, token, from);
	}
}
